package uppgift3;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * 
 * @author Gustav
 *
 * @param <E extends Edge>
 */
class ComparableEdge<E extends Edge> implements Comparable<ComparableEdge<E>> {
	int endPoint;
	double weight;
	List<E> route = new ArrayList<E>();
	
	public ComparableEdge(int endPoint, double weight, List<E> route) {
		this.endPoint = endPoint;
		this.weight = weight;
		this.route = route;
	}
	
	public int compareTo(ComparableEdge<E> compareEdge){
		if(compareEdge == null) {
			throw new NullPointerException();
		}
		
		if (this.weight > compareEdge.weight) {
			return 1;
		} else if(this.weight < compareEdge.weight) {
			return -1;
		} else	 {
			return 0;
		}
	}
}